
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Monitor monitor = new Monitor(1);
		Hilo1 r1 = new Hilo1(monitor);
		Thread h1 = new Thread(r1);
		h1.start();
		Hilo2 r2 = new Hilo2(monitor);
		Thread h2 = new Thread(r2);
		h2.start();
		try {
			h1.join();
			h2.join();
		} catch (InterruptedException e) {System.out.println("Programa terminado incorrectamente");}
		
		System.out.println("hilos terminados correctamente");
		
		
	}

}
